package com.ysd.crm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ysd.crm.entity.UserRoles;
import com.ysd.crm.entity.Users;
import com.ysd.crm.mapper.UsersMapper;
import com.ysd.crm.service.UsersService;
@Service
public class UsersServiceImpl implements UsersService{
	@Autowired
	private UsersMapper uMapper;
	@Override
	public List<Users> findUsers(Users s) {
		// TODO Auto-generated method stub
		return uMapper.getUsers(s);
	}

	@Override
	public int findCount(Users s) {
		// TODO Auto-generated method stub
		return uMapper.getCount(s);
	}

	@Override
	public int insertUsers(Users s) {
		// TODO Auto-generated method stub
		return uMapper.addUsers(s);
	}

	@Override
	public int findName(Users s) {
		// TODO Auto-generated method stub
		return uMapper.getName(s);
	}
	
	/**
	 * ytt
	 * 根据锁定查询
	 * @param u
	 * @return
	 */
	@Override
	public Users findByLockout(Users u) {
		// TODO Auto-generated method stub
		return uMapper.getByLockout(u);
	}
	/**
	 * ytt
	 * 修改 是否锁定
	 * @param u
	 * @return
	 */
	@Override
	public int updateLockout(Users u) {
		// TODO Auto-generated method stub
		return uMapper.updLockout(u);
	}
	/**
	 * ytt
	 * 修改用户
	 * @param u
	 * @return
	 */
	@Override
	public int updateUsers(Users u) {
		// TODO Auto-generated method stub
		return uMapper.updUsers(u);
	}
	/**
	 * ytt
	 * 重置密码
	 * @param u
	 * @return
	 */
	@Override
	public int updatePas(Users u) {
		// TODO Auto-generated method stub
		return uMapper.updPas(u);
	}

	@Override
	public int updateUserLoginInfo(Users u) {
		// TODO Auto-generated method stub
		return uMapper.updateUserLoginInfo(u);
	}

	/**
	 * ytt
	 * 删除前查询判断
	 * @param u
	 * @return
	 */
	@Override
	public List<UserRoles> findById(String Id) {
		// TODO Auto-generated method stub
		return uMapper.getById(Id);
	}
	/**
	 * ytt
	 * 删除 users
	 * @param u
	 * @return
	 */
	@Override
	public int deleteUsers(String Id) {
		// TODO Auto-generated method stub
		return uMapper.delUsers(Id);
	}
	/**
	 * ytt
	 * 修改密码判断查询
	 * @param u
	 * @return
	 */
	@Override
	public Users findUserPasById(Users u) {
		// TODO Auto-generated method stub
		return uMapper.getUserPasById(u);
	}

	/**
	 * ytt
	 * 修改密码
	 * @param u
	 * @return
	 */
	@Override
	public int updateUserPasById(Users u) {
		// TODO Auto-generated method stub
		return uMapper.updUserPasById(u);
	}
}
